package com.barneyx.mshinfoplatform

import com.barneyx.mshinfoplatform.entity.area.AreaEntity

fun main() {
    println("Hello World")
    val areaEntity: AreaEntity? = AreaEntity().let { it.setAreaId("001") }
    areaEntity?.let {
        it.setDefaultArea(true)
    }
    println(areaEntity.toString())


    //let返回值是最后一行

    var result = areaEntity?.let {
        it.setAreaName("Hello World")
        123
    }

    println(result)

    // also 返回值是传入和对象的本身

    var result2 = areaEntity?.also {
        it.areaNickName = "Baizengfei"
        2222222
    }
    println(result2)


    //with

    with(areaEntity) {
       println("asdfasdfasdfasdfasdfadsfasdfasdaf ${this!!.areaNickName}")
    }


}